# 作者: 陈其志
# 2025年02月17日20时01分35秒
# 2716847110@qq.com

def use_float():
    """
    浮点的精度是17位，超过溢出，准确是到16位
    :return:
    """
    f = 1.123456789123456789
    print(f)


def use_bool():
    """
    查看bool类型的输出和运算
    :return:
    """
    # print(1 == 2)
    print(False + 2)  # true =1 false =0 print()


def use_complex():
    """
    使用复数,前面是实数，后面是虚数
    :return:
    """
    c = complex(1, 2)
    print(c)
    d = complex(2, 3)
    print(d)
    print(c.real, c.imag)
    print(d.real, d.imag)
    print("c is %d+%dj " % (c.real, c.imag))


def use_char():
    """
    使用单引号和双引号以及转义字符
    :return:
    """
    print("abc\ndef")
    print('abc\'def')
    print("abc\'def")
    print("abc\rdef")   # \r 回到行首
    print("def\rabc")
    print("def\tabc")    # \t 制表符


def use_ascii():
    """
    查看ASCII码
    :return:
    """
    a = 'a'
    A = 'A'
    # ord()函数返回字符的ASCII码值
    print(ord(a))
    print(ord(A))


# use_float()
# use_bool()
# use_complex()
use_char()
# use_ascii()
